Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web build with emscripten #90

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Web build with emscripten #90

wants to merge 23 commits into from

Conversation

Totto16
Copy link
Collaborator

@Totto16 Totto16 commented Apr 30, 2023

No description provided.

@Totto16 Totto16 added the new-platform yet another platform label May 8, 2023
@Totto16 Totto16 added the stale This is stale for a long time label May 12, 2024
Copy link

github-actions bot commented Nov 15, 2024

badge

Code Coverage Summary

Filename                                                    Stmts    Miss  Cover    Missing
--------------------------------------------------------  -------  ------  -------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
src/discord/core.cpp                                          104     104  0.00%    11-181
src/discord/core.hpp                                            6       6  0.00%    81-90
src/game/bag.cpp                                               22       0  100.00%
src/game/bag.hpp                                                2       0  100.00%
src/game/command_line_arguments.cpp                             5       5  0.00%    7-16
src/game/game.cpp                                              61      61  0.00%    8-109
src/game/game.hpp                                               0       0  100.00%
src/game/graphic_helpers.cpp                                   42      42  0.00%    12-94
src/game/grid.cpp                                              74      74  0.00%    6-113
src/game/grid.hpp                                               0       0  100.00%
src/game/rotation.cpp                                          23      23  0.00%    5-37
src/game/simulated_tetrion.cpp                                352     287  18.47%   32-125, 139-175, 181-349, 353, 375-376, 408-410, 424, 429-455, 463-541
src/game/simulated_tetrion.hpp                                  7       7  0.00%    137-143
src/game/simulation.cpp                                        52      27  48.08%   30-40, 61-62, 81-103
src/game/simulation.hpp                                         0       0  100.00%
src/game/tetrion.cpp                                           78      78  0.00%    15-148
src/game/tetromino.cpp                                         44      24  45.45%   5-36, 42-48
src/game/tetromino.hpp                                          5       0  100.00%
src/graphics/rect.hpp                                          23      23  0.00%    16-55
src/graphics/renderer.cpp                                      73      73  0.00%    8-126
src/graphics/renderer.hpp                                      30      30  0.00%    35-79
src/graphics/sdl_context.cpp                                   14      14  0.00%    19-54
src/graphics/text.cpp                                          11      11  0.00%    6-25
src/graphics/text.hpp                                           0       0  100.00%
src/graphics/texture.cpp                                       71      71  0.00%    7-118
src/graphics/texture.hpp                                        9       9  0.00%    53-63
src/graphics/window.cpp                                        41      41  0.00%    6-62
src/helper/clock_source.cpp                                    28      28  0.00%    8-47
src/helper/clock_source.hpp                                     7       7  0.00%    12-27
src/helper/git_helper.hpp                                       2       2  0.00%    7-11
src/helper/graphic_utils.cpp                                   40      40  0.00%    5-184
src/helper/graphic_utils.hpp                                    0       0  100.00%
src/helper/message_box.cpp                                      7       7  0.00%    7-22
src/helper/music_utils.hpp                                      4       4  0.00%    9-30
src/helper/nfd.cpp                                            108     108  0.00%    22-197
src/helper/nfd_include.hpp                                      1       1  0.00%    23
src/helper/platform.cpp                                        12      12  0.00%    20-114
src/helper/platform.hpp                                         4       4  0.00%    16-40
src/input/controller_input.cpp                                161     161  0.00%    12-323
src/input/controller_input.hpp                                 52      52  0.00%    58-167
src/input/game_input.cpp                                       67      67  0.00%    8-99
src/input/game_input.hpp                                       16      10  37.50%   59-72, 78-91, 98-100
src/input/guid.cpp                                             18      18  0.00%    10-41
src/input/guid.hpp                                             46      46  0.00%    34-143
src/input/input.cpp                                           200     200  0.00%    20-427
src/input/input_creator.cpp                                    73      73  0.00%    22-157
src/input/input_creator.hpp                                     6       0  100.00%
src/input/input.hpp                                             9       9  0.00%    132-146
src/input/joystick_input.cpp                                  205     205  0.00%    18-970
src/input/joystick_input.hpp                                   73      73  0.00%    35-450
src/input/keyboard_input.cpp                                  128     128  0.00%    8-220
src/input/keyboard_input.hpp                                   51      51  0.00%    47-161
src/input/mouse_input.cpp                                      36      36  0.00%    9-79
src/input/mouse_input.hpp                                       0       0  100.00%
src/input/replay_input.cpp                                     53      49  7.55%    14-97
src/input/replay_input.hpp                                      0       0  100.00%
src/input/touch_input.cpp                                     175     175  0.00%    13-344
src/input/touch_input.hpp                                      57      57  0.00%    58-223
src/libs/core/game/mino.cpp                                    10       6  40.00%   3-4, 15-20
src/libs/core/game/mino.hpp                                     3       0  100.00%
src/libs/core/game/mino_stack.cpp                              55      46  16.36%   7-17, 21, 29-30, 36-86
src/libs/core/game/mino_stack.hpp                               0       0  100.00%
src/libs/core/game/tetromino_type.cpp                          22      22  0.00%    5-45
src/libs/core/hash-library/sha256.cpp                         417      28  93.29%   471-474, 504, 515, 521, 530, 546, 551-566, 593-604
src/libs/core/helper/bool_wrapper.hpp                          11      11  0.00%    15-37
src/libs/core/helper/color.cpp                                 86      36  58.14%   11-31, 38-53, 61, 75, 145-157, 161-164
src/libs/core/helper/color.hpp                                 95      86  9.47%    29-59, 85-113, 156-263
src/libs/core/helper/color_literals.hpp                       320      30  90.62%   412, 582, 647-694, 708-711
src/libs/core/helper/const_utils.hpp                           17       1  94.12%   72
src/libs/core/helper/date.cpp                                  46      46  0.00%    9-114
src/libs/core/helper/errors.cpp                                29      29  0.00%    3-49
src/libs/core/helper/errors.hpp                                 0       0  100.00%
src/libs/core/helper/parse_json.cpp                            27      27  0.00%    6-62
src/libs/core/helper/parse_json.hpp                            84      84  0.00%    28-186
src/libs/core/helper/point.hpp                                 32      17  46.88%   17, 22-23, 34-35, 50-66, 77-78, 97, 131-132
src/libs/core/helper/random.cpp                                13       7  46.15%   5, 11-16, 24-25
src/libs/core/helper/random.hpp                                 4       0  100.00%
src/libs/core/helper/sleep.cpp                                 15      15  0.00%    20-73
src/libs/core/helper/static_string.hpp                         30      30  0.00%    17-140
src/libs/core/helper/string_manipulation.cpp                   41       7  82.93%   16-23
src/libs/core/helper/timer.cpp                                 18      18  0.00%    6-32
src/libs/core/helper/timer.hpp                                  0       0  100.00%
src/libs/core/helper/utils.hpp                                 18      12  33.33%   61-112
src/libs/recordings/utility/additional_information.cpp        329     200  39.21%   9-39, 49, 54, 74-85, 88-99, 102-107, 110-115, 118-123, 134-139, 149-183, 205, 214, 223, 242, 250, 257-269, 273-285, 290-295, 300-305, 310-315, 322, 330-335, 342, 347-389, 395, 404, 407, 413, 422-423, 430-431, 442, 450, 453-455, 462-520, 541, 551-564
src/libs/recordings/utility/additional_information.hpp         23      14  39.13%   58, 62-179
src/libs/recordings/utility/checksum_helper.cpp                10       5  50.00%   7-13
src/libs/recordings/utility/checksum_helper.hpp                13       0  100.00%
src/libs/recordings/utility/helper.hpp                         81      28  65.43%   35-36, 58-59, 67, 73-74, 84, 93, 102, 109, 115, 127-154
src/libs/recordings/utility/recording.cpp                      21       3  85.71%   16-17, 42
src/libs/recordings/utility/recording.hpp                       4       0  100.00%
src/libs/recordings/utility/recording_reader.cpp              151      62  58.94%   42, 45, 52, 55-57, 63, 72, 80, 92, 95-97, 131, 137, 143, 147-148, 153, 161-208, 214-215, 222-223, 229-230, 241-242, 248-249, 256-257, 263-264, 268-269, 275-277
src/libs/recordings/utility/recording_reader.hpp                0       0  100.00%
src/libs/recordings/utility/recording_writer.cpp               90      90  0.00%    5-184
src/libs/recordings/utility/recording_writer.hpp                6       6  0.00%    55-62
src/libs/recordings/utility/tetrion_core_information.hpp        6       0  100.00%
src/libs/recordings/utility/tetrion_snapshot.cpp              110      70  36.36%   32, 37, 42, 47, 52, 57, 65, 70, 75, 80-81, 105-225
src/libs/recordings/utility/tetrion_snapshot.hpp                0       0  100.00%
src/lobby/api.cpp                                             144     144  0.00%    30-291
src/lobby/client.cpp                                           42      42  0.00%    10-109
src/lobby/client.hpp                                           12      12  0.00%    81-100
src/lobby/httplib_client.cpp                                   52      52  0.00%    8-122
src/lobby/types.hpp                                            13      13  0.00%    15-82
src/lobby/credentials/buffer.cpp                               28      28  0.00%    7-51
src/lobby/credentials/secret.cpp                               66      66  0.00%    16-146
src/manager/event_dispatcher.hpp                               37      37  0.00%    39-123
src/manager/event_listener.hpp                                  6       6  0.00%    6-19
src/manager/font.cpp                                           12      12  0.00%    5-18
src/manager/font.hpp                                            3       3  0.00%    15-18
src/manager/music_manager.cpp                                 227     227  0.00%    17-403
src/manager/music_manager.hpp                                  12      12  0.00%    69-86
src/manager/resource_manager.hpp                                2       2  0.00%    30-31
src/manager/sdl_controller_key.cpp                             18      18  0.00%    5-34
src/manager/sdl_controller_key.hpp                              3       3  0.00%    34-36
src/manager/sdl_key.cpp                                       222      29  86.94%   27, 75-76, 154-156, 205-211, 222-223, 230, 288, 313, 367-368, 418-436, 446-447
src/manager/sdl_key.hpp                                         3       3  0.00%    118-120
src/manager/settings.cpp                                       18      18  0.00%    10-34
src/manager/settings.hpp                                       34      34  0.00%    20-73
src/manager/settings_manager.cpp                               41      41  0.00%    12-72
src/scenes/scene.cpp                                           18      18  0.00%    15-56
src/scenes/scene.hpp                                           13      13  0.00%    25-75
src/scenes/about_page/about_page.cpp                           57      57  0.00%    19-121
src/scenes/about_page/about_page.hpp                            0       0  100.00%
src/scenes/loading_screen/loading_screen.cpp                   68      68  0.00%    16-127
src/scenes/logo/logo.cpp                                       25      25  0.00%    11-147
src/scenes/main_menu/main_menu.cpp                             97      97  0.00%    13-166
src/scenes/main_menu/main_menu.hpp                              0       0  100.00%
src/scenes/multiplayer_menu/multiplayer_menu.cpp               76      76  0.00%    12-129
src/scenes/multiplayer_menu/multiplayer_menu.hpp                0       0  100.00%
src/scenes/online_lobby/online_lobby.cpp                       86      86  0.00%    19-155
src/scenes/online_lobby/online_lobby.hpp                        0       0  100.00%
src/scenes/play_select_menu/play_select_menu.cpp               76      76  0.00%    11-129
src/scenes/play_select_menu/play_select_menu.hpp                0       0  100.00%
src/scenes/recording_selector/recording_chooser.cpp            75      75  0.00%    12-136
src/scenes/recording_selector/recording_chooser.hpp             0       0  100.00%
src/scenes/recording_selector/recording_component.cpp          93      93  0.00%    13-162
src/scenes/recording_selector/recording_component.hpp           1       1  0.00%    22
src/scenes/recording_selector/recording_selector.cpp          129     129  0.00%    30-233
src/scenes/recording_selector/recording_selector.hpp            2       2  0.00%    23-25
src/scenes/replay_game/replay_game.cpp                         80      80  0.00%    14-163
src/scenes/replay_game/replay_game.hpp                          0       0  100.00%
src/scenes/settings_menu/color_setting_row.cpp                123     123  0.00%    16-238
src/scenes/settings_menu/color_setting_row.hpp                  0       0  100.00%
src/scenes/settings_menu/settings_details.hpp                   1       1  0.00%    11
src/scenes/settings_menu/settings_menu.cpp                    161     161  0.00%    22-279
src/scenes/settings_menu/settings_menu.hpp                      2       2  0.00%    29-31
src/scenes/single_player_game/game_over.cpp                    26      26  0.00%    14-65
src/scenes/single_player_game/game_over.hpp                     0       0  100.00%
src/scenes/single_player_game/pause.cpp                        36      36  0.00%    11-63
src/scenes/single_player_game/pause.hpp                         0       0  100.00%
src/scenes/single_player_game/single_player_game.cpp           75      75  0.00%    20-142
src/scenes/single_player_game/single_player_game.hpp            0       0  100.00%
src/ui/focusable.hpp                                           26      26  0.00%    15-66
src/ui/hoverable.hpp                                           31      31  0.00%    17-80
src/ui/layout.cpp                                              32      32  0.00%    5-62
src/ui/layout.hpp                                              40      40  0.00%    21-149
src/ui/widget.cpp                                               4       4  0.00%    7-12
src/ui/widget.hpp                                              12      12  0.00%    29-56
src/ui/components/abstract_slider.hpp                         128     128  0.00%    28-243
src/ui/components/button.hpp                                   54      54  0.00%    30-131
src/ui/components/color_picker.cpp                            322     322  0.00%    17-565
src/ui/components/color_picker.hpp                              0       0  100.00%
src/ui/components/image_button.cpp                             12      12  0.00%    5-27
src/ui/components/image_button.hpp                              0       0  100.00%
src/ui/components/image_view.cpp                               16      16  0.00%    5-34
src/ui/components/image_view.hpp                                0       0  100.00%
src/ui/components/label.cpp                                    15      15  0.00%    6-36
src/ui/components/label.hpp                                     0       0  100.00%
src/ui/components/link_label.cpp                               43      43  0.00%    6-81
src/ui/components/link_label.hpp                                0       0  100.00%
src/ui/components/slider.cpp                                   39      39  0.00%    7-75
src/ui/components/slider.hpp                                    0       0  100.00%
src/ui/components/text_button.cpp                              33      33  0.00%    5-65
src/ui/components/text_button.hpp                               0       0  100.00%
src/ui/components/textinput.cpp                               294     294  0.00%    17-550
src/ui/layouts/focus_layout.cpp                               169     169  0.00%    10-296
src/ui/layouts/focus_layout.hpp                                28      28  0.00%    48-105
src/ui/layouts/grid_layout.cpp                                 44      44  0.00%    5-72
src/ui/layouts/grid_layout.hpp                                  0       0  100.00%
src/ui/layouts/scroll_layout.cpp                              226     226  0.00%    6-392
src/ui/layouts/scroll_layout.hpp                               13      13  0.00%    73-91
src/ui/layouts/tile_layout.cpp                                 40      40  0.00%    5-57
src/ui/layouts/tile_layout.hpp                                  9       9  0.00%    31-49
TOTAL                                                        8970    7421  17.27%

Results for commit: 2898d62

Minimum allowed coverage is 0%

♻️ This comment has been updated with latest results

@Totto16 Totto16 marked this pull request as ready for review November 15, 2024 00:26
Copy link

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v19.1.4) reports: 46 concern(s)
  • src/executables/game/application.hpp:54:8: warning: [cppcoreguidelines-special-member-functions]

    class 'Application' defines a copy constructor and a copy assignment operator but does not define a destructor, a move constructor or a move assignment operator

       54 | struct Application final : public EventListener, public ServiceProvider {
          |        ^
  • src/helper/web_utils.hpp:7:2: error: [clang-diagnostic-error]

    "this header is for emscripten only"

        7 | #error "this header is for emscripten only"
          |  ^
  • src/helper/web_utils.hpp:11:2: error: [clang-diagnostic-error]

    "need emscripten threads support"

       11 | #error "need emscripten threads support"
          |  ^
  • src/helper/web_utils.hpp:35:9: warning: [google-readability-todo]

    missing username/bug in TODO

       35 |         //TODO, these support more arguments, write templates for that
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |         // TODO(runner): , these support more arguments, write templates for that
  • src/lobby/web_client.cpp:14:11: warning: [cert-dcl58-cpp]

    modification of 'std' namespace can result in undefined behavior

       14 | namespace {
          |           ^
    /../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:47:11: note: 'std' namespace opened here
       47 | namespace std _GLIBCXX_VISIBILITY(default)
          |           ^
  • src/lobby/web_client.cpp:21:9: warning: [cppcoreguidelines-owning-memory]

    initializing non-owner 'auto *' with a newly created 'gsl::owner<>'

       21 |         auto* headersRawDst = new char[header_length + 1];
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • src/lobby/web_client.cpp:21:15: warning: [readability-identifier-naming]

    invalid case style for local pointer 'headersRawDst'

       21 |         auto* headersRawDst = new char[header_length + 1];
          |               ^~~~~~~~~~~~~
          |               headers_raw_dst
  • src/lobby/web_client.cpp:24:16: warning: [readability-identifier-naming]

    invalid case style for local pointer 'unpackedHeaders'

       24 |         char** unpackedHeaders = emscripten_fetch_unpack_response_headers(headersRawDst);
          |                ^~~~~~~~~~~~~~~
          |                unpacked_headers
       25 | 
       26 |         FetchHeader result{};
       27 | 
       28 |         u32 i = 0;
       29 |         while (true) {
       30 |             auto* headerKey = unpackedHeaders[i];
          |                               ~~~~~~~~~~~~~~~
          |                               unpacked_headers
       31 | 
       32 |             if (headerKey == nullptr) {
       33 |                 break;
       34 |             }
       35 | 
       36 |             auto* headerValue = unpackedHeaders[i + 1];
          |                                 ~~~~~~~~~~~~~~~
          |                                 unpacked_headers
  • src/lobby/web_client.cpp:28:13: warning: [readability-identifier-length]

    variable name 'i' is too short, expected at least 3 characters

       28 |         u32 i = 0;
          |             ^
  • src/lobby/web_client.cpp:30:19: warning: [readability-identifier-naming]

    invalid case style for local pointer 'headerKey'

       30 |             auto* headerKey = unpackedHeaders[i];
          |                   ^~~~~~~~~
          |                   header_key
       31 | 
       32 |             if (headerKey == nullptr) {
          |                 ~~~~~~~~~
          |                 header_key
  • src/lobby/web_client.cpp:36:19: warning: [readability-identifier-naming]

    invalid case style for local pointer 'headerValue'

       36 |             auto* headerValue = unpackedHeaders[i + 1];
          |                   ^~~~~~~~~~~
          |                   header_value
       37 |             if (headerValue == nullptr) {
          |                 ~~~~~~~~~~~
          |                 header_value
  • src/lobby/web_client.cpp:39:17: warning: [google-readability-todo]

    missing username/bug in TODO

       39 |                 //TODO: report that properly
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                 // TODO(runner): report that properly
  • src/lobby/web_client.cpp:63:16: warning: [performance-enum-size]

    enum 'FetchReadyState' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size

       63 |     enum class FetchReadyState {
          |                ^
  • src/lobby/web_client.cpp:66:9: warning: [readability-identifier-naming]

    invalid case style for scoped enum constant 'HEADERS_RECEIVED'

       66 |         HEADERS_RECEIVED = 2,
          |         ^~~~~~~~~~~~~~~~
          |         HeadersReceived
  • src/lobby/web_client.cpp:76:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_request, m_response_headers

       76 | oopetris::http::implementation::ActualResult::ActualResult(std::unique_ptr<emscripten_fetch_t>&& request)
          | ^
  • src/lobby/web_client.cpp:76:98: warning: [cppcoreguidelines-rvalue-reference-param-not-moved]

    rvalue reference parameter 'request' is never moved from inside the function body

       76 | oopetris::http::implementation::ActualResult::ActualResult(std::unique_ptr<emscripten_fetch_t>&& request)
          |                                                                                                  ^
  • src/lobby/web_client.cpp:84:2: warning: [cert-dcl58-cpp]

    modification of 'std' namespace can result in undefined behavior

       84 | };
          |  ^
    /../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:47:11: note: 'std' namespace opened here
       47 | namespace std _GLIBCXX_VISIBILITY(default)
          |           ^
  • src/lobby/web_client.cpp:87:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_request, m_response_headers

       87 | oopetris::http::implementation::ActualResult::ActualResult(ActualResult&& other) noexcept
          | ^
  • src/lobby/web_client.cpp:91:88: warning: [readability-convert-member-functions-to-static]

    method 'get_header' can be made static

       91 | [[nodiscard]] std::optional<std::string> oopetris::http::implementation::ActualResult::get_header(const std::string& key
          |                                                                                        ^
          |               static 
       92 | ) const {
          |   ~~~~~
  • src/lobby/web_client.cpp:100:73: warning: [readability-convert-member-functions-to-static]

    method 'body' can be made static

      100 | [[nodiscard]] std::string oopetris::http::implementation::ActualResult::body() const {
          |                                                                         ^      ~~~~~
          |               static 
  • src/lobby/web_client.cpp:102:5: warning: [google-readability-todo]

    missing username/bug in TODO

      102 |     //TODO: test if this is correct
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |     // TODO(runner): test if this is correct
  • src/lobby/web_client.cpp:114:88: warning: [readability-convert-member-functions-to-static]

    method 'get_error' can be made static

      114 | [[nodiscard]] std::optional<std::string> oopetris::http::implementation::ActualResult::get_error() const {
          |                                                                                        ^           ~~~~~
          |               static 
  • src/lobby/web_client.cpp:116:10: warning: [readability-identifier-naming]

    invalid case style for local variable 'readyState'

      116 |     auto readyState = static_cast<FetchReadyState>(m_request->readyState);
          |          ^~~~~~~~~~
          |          ready_state
      117 | 
      118 |     if (readyState != FetchReadyState::DONE) {
          |         ~~~~~~~~~~
          |         ready_state
  • src/lobby/web_client.cpp:125:11: warning: [cert-dcl58-cpp]

    modification of 'std' namespace can result in undefined behavior

      125 | namespace {
          |           ^
    /../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:47:11: note: 'std' namespace opened here
       47 | namespace std _GLIBCXX_VISIBILITY(default)
          |           ^
  • src/lobby/web_client.cpp:136:28: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'concat_url' of similar type ('const int &') are easily swapped by mistake

      136 |     std::string concat_url(const std::string& normalized_base, const std::string& value) {
          |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/oopetris/oopetris/src/lobby/web_client.cpp:136:47: note: the first parameter in the range is 'normalized_base'
      136 |     std::string concat_url(const std::string& normalized_base, const std::string& value) {
          |                                               ^~~~~~~~~~~~~~~
    /home/runner/work/oopetris/oopetris/src/lobby/web_client.cpp:136:83: note: the last parameter in the range is 'value'
      136 |     std::string concat_url(const std::string& normalized_base, const std::string& value) {
          |                                                                                   ^~~~~
  • src/lobby/web_client.cpp:145:13: warning: [bugprone-easily-swappable-parameters]

    4 adjacent parameters of 'make_request_impl' of similar type ('const int &') are easily swapped by mistake

      145 |             const std::string& method,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
      146 |             const std::string& url,
          |             ~~~~~~~~~~~~~~~~~~~~~~~
      147 |             const FetchHeader& header,
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
      148 |             const std::optional<FetchData>& data
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/oopetris/oopetris/src/lobby/web_client.cpp:145:32: note: the first parameter in the range is 'method'
      145 |             const std::string& method,
          |                                ^~~~~~
    /home/runner/work/oopetris/oopetris/src/lobby/web_client.cpp:148:45: note: the last parameter in the range is 'data'
      148 |             const std::optional<FetchData>& data
          |                                             ^~~~
  • src/lobby/web_client.cpp:186:18: warning: [bugprone-easily-swappable-parameters]

    3 adjacent parameters of 'make_request' of similar type ('const int &') are easily swapped by mistake

      186 |     make_request(const std::string& method, const std::string& url, const FetchHeader& header) {
          |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/oopetris/oopetris/src/lobby/web_client.cpp:186:37: note: the first parameter in the range is 'method'
      186 |     make_request(const std::string& method, const std::string& url, const FetchHeader& header) {
          |                                     ^~~~~~
    /home/runner/work/oopetris/oopetris/src/lobby/web_client.cpp:186:88: note: the last parameter in the range is 'header'
      186 |     make_request(const std::string& method, const std::string& url, const FetchHeader& header) {
          |                                                                                        ^~~~~~
  • src/lobby/web_client.cpp:191:13: warning: [bugprone-easily-swappable-parameters]

    4 adjacent parameters of 'make_request_with_data' of similar type ('const int &') are easily swapped by mistake

      191 |             const std::string& method,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
      192 |             const std::string& url,
          |             ~~~~~~~~~~~~~~~~~~~~~~~
      193 |             const FetchHeader& header,
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
      194 |             const FetchData& data
          |             ~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/oopetris/oopetris/src/lobby/web_client.cpp:191:32: note: the first parameter in the range is 'method'
      191 |             const std::string& method,
          |                                ^~~~~~
    /home/runner/work/oopetris/oopetris/src/lobby/web_client.cpp:194:30: note: the last parameter in the range is 'data'
      194 |             const FetchData& data
          |                              ^~~~
  • src/lobby/web_client.cpp:201:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_base_url, m_headers

      201 | oopetris::http::implementation::ActualClient::ActualClient(ActualClient&& other) noexcept
          | ^
  • src/lobby/web_client.cpp:207:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_base_url, m_headers

      207 | oopetris::http::implementation::ActualClient::ActualClient(const std::string& api_url)
          | ^
  • src/lobby/web_client.cpp:214:101: warning: [readability-convert-member-functions-to-static]

    method 'Get' can be made static

      214 | [[nodiscard]] std::unique_ptr<oopetris::http::Result> oopetris::http::implementation::ActualClient::Get(
          |                                                                                                     ^
          |               static 
  • src/lobby/web_client.cpp:214:101: warning: [readability-identifier-naming]

    invalid case style for public method 'Get'

      214 | [[nodiscard]] std::unique_ptr<oopetris::http::Result> oopetris::http::implementation::ActualClient::Get(
          |                                                                                                     ^~~
          |                                                                                                     get
  • src/lobby/web_client.cpp:223:101: warning: [readability-convert-member-functions-to-static]

    method 'Delete' can be made static

      223 | [[nodiscard]] std::unique_ptr<oopetris::http::Result> oopetris::http::implementation::ActualClient::Delete(
          |                                                                                                     ^
          |               static 
  • src/lobby/web_client.cpp:223:101: warning: [readability-identifier-naming]

    invalid case style for public method 'Delete'; cannot be fixed because 'delete' would conflict with a keyword

  • src/lobby/web_client.cpp:231:101: warning: [readability-convert-member-functions-to-static]

    method 'Post' can be made static

      231 | [[nodiscard]] std::unique_ptr<oopetris::http::Result> oopetris::http::implementation::ActualClient::Post(
          |                                                                                                     ^
          |               static 
  • src/lobby/web_client.cpp:231:101: warning: [readability-identifier-naming]

    invalid case style for public method 'Post'

      231 | [[nodiscard]] std::unique_ptr<oopetris::http::Result> oopetris::http::implementation::ActualClient::Post(
          |                                                                                                     ^~~~
          |                                                                                                     post
  • src/lobby/web_client.cpp:233:64: warning: [readability-named-parameter]

    all parameters should be named in a function

      233 |         const std::optional<std::pair<std::string, std::string>>& payload
          |                                                                ^
          |                                                                 /*unused*/
  • src/lobby/web_client.cpp:246:101: warning: [readability-convert-member-functions-to-static]

    method 'Put' can be made static

      246 | [[nodiscard]] std::unique_ptr<oopetris::http::Result> oopetris::http::implementation::ActualClient::Put(
          |                                                                                                     ^
          |               static 
  • src/lobby/web_client.cpp:246:101: warning: [readability-identifier-naming]

    invalid case style for public method 'Put'

      246 | [[nodiscard]] std::unique_ptr<oopetris::http::Result> oopetris::http::implementation::ActualClient::Put(
          |                                                                                                     ^~~
          |                                                                                                     put
  • src/lobby/web_client.cpp:248:64: warning: [readability-named-parameter]

    all parameters should be named in a function

      248 |         const std::optional<std::pair<std::string, std::string>>& payload
          |                                                                ^
          |                                                                 /*unused*/
  • src/lobby/web_client.cpp:261:52: warning: [readability-identifier-naming]

    invalid case style for public method 'SetBearerAuth'

      261 | void oopetris::http::implementation::ActualClient::SetBearerAuth(const std::string& token) {
          |                                                    ^~~~~~~~~~~~~
          |                                                    set_bearer_auth
  • src/lobby/web_client.hpp:4:10: error: [clang-diagnostic-error]

    'emscripten/fetch.h' file not found

        4 | #include <emscripten/fetch.h>
          |          ^~~~~~~~~~~~~~~~~~~~
  • src/lobby/web_client.hpp:11:11: warning: [cert-dcl58-cpp]

    modification of 'std' namespace can result in undefined behavior

       11 | namespace oopetris::http::implementation {
          |           ^
    /../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:47:11: note: 'std' namespace opened here
       47 | namespace std _GLIBCXX_VISIBILITY(default)
          |           ^
  • src/lobby/web_client.hpp:66:38: warning: [readability-avoid-const-params-in-decls]

    parameter 2 is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions

       66 |         Post(const std::string& url, const std::optional<std::pair<std::string, std::string>>& payload) override;
          |                                      ^~~~~
  • src/lobby/web_client.hpp:69:37: warning: [readability-avoid-const-params-in-decls]

    parameter 2 is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions

       69 |         Put(const std::string& url, const std::optional<std::pair<std::string, std::string>>& payload) override;
          |                                     ^~~~~
  • src/lobby/web_client.hpp:73:41: warning: [readability-identifier-naming]

    invalid case style for public method 'ResetBearerAuth'

       73 |         OOPETRIS_GRAPHICS_EXPORTED void ResetBearerAuth() override;
          |                                         ^~~~~~~~~~~~~~~
          |                                         reset_bearer_auth

Have any feedback or feature suggestions? Share it here.

it linked both .js and .html at the same time, so the wasm was corrupt at the end

also add a test for correct wasm files
@Totto16 Totto16 removed the stale This is stale for a long time label Nov 16, 2024
@Totto16 Totto16 self-assigned this Nov 16, 2024
@Totto16 Totto16 added this to the 0.5.7 milestone Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-platform yet another platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant